<?php
if(isset($_POST['login']) && isset($_POST['username']) && isset($_POST['password'])){
	$params = "";
	$params .= "log=".$_POST['username']."&";
	$params .= "pwd=".$_POST['password']."&";
	$params .= "redirect_to=/&";
	$params .= "testcookie=1&";
	$params .= "rememberme=forever";
				
	$login = cmsdream_login::submit($this->config->WP_URL['login'], $params);
	if($login->status['number']==302 || !isset($login->message)){
		cmsdream_login::save_sc($login->cookie);
		header("Location:$backurl");
		exit;
	}
}
